<section class="Hui-article-box">
    <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
        <span class="c-gray en">&gt;</span>
        评论管理
        <span class="c-gray en">&gt;</span>
        评论列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a> </nav>
    <div class="Hui-article">
        <article class="cl pd-20">

            <div class="cl pd-5 bg-1 bk-gray mt-20">
                <span class="r">共有数据：<strong>54</strong> 条</span>
            </div>
            <table class="table table-border table-bordered table-bg table-sort">
                <thead>
                <tr class="text-c">
                    <th width="40"><input name="" type="checkbox" value=""></th>
                    <th width="40">ID</th>
                    <th width="90">用户名称</th>
                    <th width="90">用户头像</th>
                    <th width="90">商品名称</th>
                    <th width="150">商品图片</th>
                    <th width="190">评价内容</th>
                    <th width="150">评论时间</th>
                    <th width="100">操作</th>
                </tr>
                </thead>

                <tbody>
                {if $data != ''}
                {foreach $data as $v}
                <tr class="text-c">
                    <td><input name="checkid" type="checkbox" value="{$v.id}"></td>
                    <td>{$b++}</td>
                    <td>{$v['user_name']}</td>
                    <td><img src="{$v['user_pic']}" width="50" height="50"/></td>
                    <td>{$v['goods_name']}</td>
                    <td><img src="{$v['goods_pic']}" width="50" height="50"/></td>
                    <td><a title="详情" href="javascript:;" onclick="comments_details('评论详情','detail?id={$v.id}','800','600')">{$v.contents|substr=0,40}... </a></td>
                    <td>{$v.create_time}</td>
                    <td class="td-manage">
                        <a title="回复" href="javascript:;" onclick="comments_edit('回复','reply?id={$v.id}','800','600')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6d0</i></a>
                    </td>


                        <!--<a title="删除" href="javascript:;" onclick="notice_del(this,'{$v.id}')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6e2;</i></a></td>-->
                </tr>
                {/foreach}
                {else}
                <tr class="text-c" id="empty">
                    <td colspan="9">暂无数据</td>
                </tr>
                {/if}
                </tbody>
            </table>
        </article>
    </div>
</section>



<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/static/admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="/static/admin/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/static/admin/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript">
    //分页
    if($("#empty").length > 0) {

    }else{
        $('.table-sort').dataTable({
            "aaSorting": [[ 0, "asc" ]],//默认第几个排序
            "bStateSave": true,//状态保存
            "aoColumnDefs": [
                //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
                {"orderable":false,"aTargets":[1,2,3,4]}// 不参与排序的列
            ]
        });
    }


    /*
     参数解释：
     title	标题
     url		请求的url
     id		需要操作的数据id
     w		弹出层宽度（缺省调默认值）
     h		弹出层高度（缺省调默认值）
     */
    /*评论-回复*/
    function comments_edit(title,url,w,h){
        $.get(url,{},function (data) {
            if(data.code==0){
                layer.msg(data.msg, {icon: 2, time: 1000});
            }else {
                if(data.status==1)
                {
                    layer.msg(data.msg, {icon: 2, time: 1000});
                }else{
                    layer_show(title, url, w, h);
                }
            }
        })
    }

    /*评论-详情*/
    function comments_details(title,url,w,h)
    {
        $.get(url,{},function (data) {
            if(data.code==0){
                layer.msg(data.msg, {icon: 2, time: 1000});
            }else {
                layer_show(title, url, w, h);
            }
        })
    }
</script>
<!--/请在上方写此页面业务相关的脚本-->
